class Main {
	public static void main(String[] args) {
		A a=new A();
		B b=a.getB();
		b.print();
	}
}

class A {
	public B getB() {
		return new B();
	}
}

class B extends A{
	void print() {
		System.out.println("This is B's print()");
	}
}
